package HomeWork.chapter05;

/**
 * Enjoy programming!!!
 * Time: 2021/12/4 -  21:32
 */
public class SelectSort {
    public static void main(String[] args){
        int[] a = {11,33,9,6,12};
        for(int i = 0; i < a.length ; i++){
            int k = i;
            for (int j = i + 1; j < a.length; j++){
                if (a[k] > a[j]){
                    k = j;
                }
            }
            if (k != i){
                int temp = a[k];
                a[k] = a[i];
                a[i] = temp;
            }
        }
        for (int e : a){
            System.out.printf("%d ",e);
        }
    }
}
